UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Spnmne2k+IpIhXFNJWidAZOlG9h6cFiZeRJ8Ceh8n24='
WHERE
key_id = '2ac2e89bbbc33323aeb7ebdef917123fd4bdfa209817abba65f65f76f5eb2fa3'
AND (
token = 'Spnmne2k+IpIhXFNJWidAZOlG9h6cFiZeRJ8Ceh8n24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)