UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jE24Iv2ZtfBdY9PaXUVp5WXNLoDWGj1j7j0T0qgU+ls=' 
WHERE 
  key_id = '7526a7190871286d9184098a833e51971714d6883fbd45163ddf99bf0dda79d8' 
  AND (
    token = 'jE24Iv2ZtfBdY9PaXUVp5WXNLoDWGj1j7j0T0qgU+ls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036