UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ahe1AISeJ5GfPUJZLwUPvhMTCSIr1a6/uNMu29mbnQM='
WHERE
key_id = 'd165e6e685e9ec34e985345de30a95da27c7c220ca9bafcf52bab0bbe8873e57'
AND (
token = 'Ahe1AISeJ5GfPUJZLwUPvhMTCSIr1a6/uNMu29mbnQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)