UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LziZ97RzQiZ2W2DlaaW0eZM1+GjrOngjnH2fhWyND0k='
WHERE
key_id = '1363c58d859b6f3c41db67331abcd0db2fd988886163228e39f46f79c1e10d38'
AND (
token = 'LziZ97RzQiZ2W2DlaaW0eZM1+GjrOngjnH2fhWyND0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)