UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lwrGbxJQEzeW6HeIBOxySg0zWZVHagUTgFdg8PObc5Y='
WHERE
key_id = '64bf92252c16458fcc044efcaef23d5738626923a8f019e6fe5b40038dc1dbd6'
AND (
token = 'lwrGbxJQEzeW6HeIBOxySg0zWZVHagUTgFdg8PObc5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)