UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6nCccsUizCiPAggB8XPH6g5OXyrlkzoJUWVOfV02kU='
WHERE
key_id = 'a775cc06ed07351d942a686b8402c60129d3feb69cd2b0b675b7afa13cbf4cd7'
AND (
token = 's6nCccsUizCiPAggB8XPH6g5OXyrlkzoJUWVOfV02kU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)