UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2QL3jBvGytPYisCdmSJkQEkZOHabDSjYn0SGoANYiW0='
WHERE
key_id = '2f514bb0d3a276b6a550c3aa3ed112fd7e123c2fcdf9bc8ec0b90f420760c1b7'
AND (
token = '2QL3jBvGytPYisCdmSJkQEkZOHabDSjYn0SGoANYiW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)