UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ENvgMiLqNSMuJAZkd1pKH7GbT7xzhdOT1EcFrtX2bhg='
WHERE
key_id = '62e97c49c88ad117f1e639e343e4341be5c38843c2f740706957b796f73dcde6'
AND (
token = 'ENvgMiLqNSMuJAZkd1pKH7GbT7xzhdOT1EcFrtX2bhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)