UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dF5m219ccaZ6G+CVD48+ahDJXFzjf86WoAPdXjMu4E='
WHERE
key_id = '07fe101093fc41989f79ec5e75e4902cdf3f05aeec3d4561f0574fbd08858d3c'
AND (
token = '5dF5m219ccaZ6G+CVD48+ahDJXFzjf86WoAPdXjMu4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)