UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZnjGY7EzC3guBqFP8JuilX2mmQ3fWzLJZfkiNQaP3SY='
WHERE
key_id = '92ed0896140c4839224c6a5f097909c41a835b0544f8d86fccb9563b6488ef43'
AND (
token = 'ZnjGY7EzC3guBqFP8JuilX2mmQ3fWzLJZfkiNQaP3SY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)