UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LM8SeKlR4jrCA7y6RDhEvqKxLSKSEPuRHe5WRPJb0k4=' 
WHERE 
  key_id = 'a410ae9363f01ae6734d74a080fd14a9fba82da0f2f1d88cf48589e7e5250ff3' 
  AND (
    token = 'LM8SeKlR4jrCA7y6RDhEvqKxLSKSEPuRHe5WRPJb0k4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020