UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GVfwDj+XI2R7LLfdyOuvoJqzaNl6t3hl6PtvRXRFP8o='
WHERE
key_id = 'd45346c579973239a43dd0c6742dfec6ae39e01f28b6fa451c1614aacfd36e1f'
AND (
token = 'GVfwDj+XI2R7LLfdyOuvoJqzaNl6t3hl6PtvRXRFP8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)