UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'umah+TuzTse4fbKc0e6em+ThQZBj0Ir8z3NITYGEJOQ=' 
WHERE 
  key_id = 'f97a12f30d3600b5df6a1e2f34a5ce49055de2b115541159f30cd46bf5012a54' 
  AND (
    token = 'umah+TuzTse4fbKc0e6em+ThQZBj0Ir8z3NITYGEJOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033