UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6RBcEjr1qGlK4Fo499xyygu7JBVTcD/ENB250bhj4lg=' 
WHERE 
  key_id = '7d8093d95ea7bc234b40da9aba0b6fe2c3d6ac62cdc803002caabd0c87f470cd' 
  AND (
    token = '6RBcEjr1qGlK4Fo499xyygu7JBVTcD/ENB250bhj4lg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036