UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUTgF+pPXNEmbU3jBZUHUy5aX2bF3ffbgLCijMYUtac=' 
WHERE 
  key_id = 'c5f83d4847785f0c0046a33a67c77b1f134a0e2ba89787e863fd81ddffc73c33' 
  AND (
    token = 'MUTgF+pPXNEmbU3jBZUHUy5aX2bF3ffbgLCijMYUtac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041