UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xQJVtP4F5nGDxEBA4XEEuVmiQoijtCEZfoIkr+f28kk='
WHERE
key_id = '6a7625c52a41c9cf26bbe36a4aa8875cc80bcdbc586b6cc5c025d8ebf0493be0'
AND (
token = 'xQJVtP4F5nGDxEBA4XEEuVmiQoijtCEZfoIkr+f28kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)