UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gv75VMxUjYyvnFKR5SDe+WadfDMOTfEoJ/l35vaSMH0=' 
WHERE 
  key_id = 'b2c9d28cc1775fc79f397f49e517eaef8ba701b5b617a52de2cef60aa827aa2e' 
  AND (
    token = 'gv75VMxUjYyvnFKR5SDe+WadfDMOTfEoJ/l35vaSMH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043