UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nbcgeWM7swMTCaxSJj2iM5xdd27G6DaYQ9IoOhhiYXs='
WHERE
key_id = 'b03458fe5f59009424b27674a2849c15dc94f50aa3a20db5f1760570aab67ea6'
AND (
token = 'nbcgeWM7swMTCaxSJj2iM5xdd27G6DaYQ9IoOhhiYXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)