UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzA0YUHxaO5+GV0tw7fRYgoSyo2EPKfIx1N77Ui9gY0='
WHERE
key_id = '27394c1a524873c858e5514e5f7489432fad0f9a82a24d2d2ebd44b072808ebe'
AND (
token = 'LzA0YUHxaO5+GV0tw7fRYgoSyo2EPKfIx1N77Ui9gY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)