UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RTSW3caVdd/OpK5Z6UmxNYy854XhEm8FEcskuFpL9uk='
WHERE
key_id = '0156400281e90550fc8294cb76f0bfa729ef17458a104f82f98714b8bda7d82d'
AND (
token = 'RTSW3caVdd/OpK5Z6UmxNYy854XhEm8FEcskuFpL9uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)