UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sfnXDmahzVFKJlN7oMPKf+u9rA7FAwb/0w33dc8Byu4='
WHERE
key_id = '622d8731bc1f7105751a6653fceb6cc14a2633cec4e2a5fdcfefd7078094003d'
AND (
token = 'sfnXDmahzVFKJlN7oMPKf+u9rA7FAwb/0w33dc8Byu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)