UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gaDIhyJIRrIEV+xqfhPDIC4M2gRUc+WsbV34T5JjhVY='
WHERE
key_id = 'e2dc331658c6260e5e2e87de3a199d5c5d191dab10f15e5176b5e4bb0fc8bcad'
AND (
token = 'gaDIhyJIRrIEV+xqfhPDIC4M2gRUc+WsbV34T5JjhVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)