UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNmysiq8tMyhJfeJvDTXiCekgzAaZKpkRBbWBHCCsu8='
WHERE
key_id = '550b813c025542b918c015240d4d6dd1e0471e568883ae6a78fd6188f3fc5cf5'
AND (
token = 'VNmysiq8tMyhJfeJvDTXiCekgzAaZKpkRBbWBHCCsu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)