UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IeQO3JumbSWL8lEquo/HZOWhbH9pMI3vW41OV369cPY='
WHERE
key_id = 'd260ee73004014b6bd71232bc6c4c639cef4bb2b406c2fea6a1d4e251476f29e'
AND (
token = 'IeQO3JumbSWL8lEquo/HZOWhbH9pMI3vW41OV369cPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)