UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S23FYOHX2pJM77c5yC+EDC26QnXw0/g0YcFmK9vbKGI='
WHERE
key_id = '910cb178100062d1eca7fbf587a77506256b2eceac98f13cedf47736f10bfd6c'
AND (
token = 'S23FYOHX2pJM77c5yC+EDC26QnXw0/g0YcFmK9vbKGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)