UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQWFbf8CbHBP/OVx2FJQlgTEWjiao8XciR0wcQO6w5s='
WHERE
key_id = '948039e5d5897e7ecbf2d3a998df93ed2a40afe069ccf6c80f9ac018aec63fe7'
AND (
token = 'mQWFbf8CbHBP/OVx2FJQlgTEWjiao8XciR0wcQO6w5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)