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

Query time 0.00053