UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LO0KugE8kyvee9nEbbgs+Gtw+2j2zPLy4AyAygD8se4=' 
WHERE 
  key_id = '04321ffcc8f2909d895f75319ed48f12281b90164d2dbc26ca6defb538cbbed9' 
  AND (
    token = 'LO0KugE8kyvee9nEbbgs+Gtw+2j2zPLy4AyAygD8se4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035