UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rqmZV/u/EGyhxtXWhJMIZ3+aNv1bDmviEpQmQXzcJH0=' 
WHERE 
  key_id = 'fc834b1378e2af95eb13d07809dfef1578e73545ecc977af9bfbf6b6cc24bdf5' 
  AND (
    token = 'rqmZV/u/EGyhxtXWhJMIZ3+aNv1bDmviEpQmQXzcJH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027