UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ilyD6gQrHZHmgZLZr7Rhb/XIAdl6h2sK+EpiPEGaZ5Q=' 
WHERE 
  key_id = 'f8801d447f4ae3c8cfcec80699b2c635c75cb4a0c5062d3d3debc94f36fbbc3c' 
  AND (
    token = 'ilyD6gQrHZHmgZLZr7Rhb/XIAdl6h2sK+EpiPEGaZ5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037