UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2A4CUIkd85AZgsPXaBTFp6+GnCL8/2NF9bDr43djLh0='
WHERE
key_id = '27ef09cc86b40b8ba245e1b46c33e0ab88e61d5a5e8e7dc4e18526ff41246d73'
AND (
token = '2A4CUIkd85AZgsPXaBTFp6+GnCL8/2NF9bDr43djLh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)