UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o5x61H5RHpGNRTCOeSKjr4yc87VkHhOuZWiFyijKpsY='
WHERE
key_id = '0a76f72766029d62550ff716e2074ebf2fe38eff95cbb01780d80ca3c90255cd'
AND (
token = 'o5x61H5RHpGNRTCOeSKjr4yc87VkHhOuZWiFyijKpsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)