UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6CuMM85WS/M96zRtTL8y+WCXiNMXG6XUWlY6c2LwGJ4=' 
WHERE 
  key_id = '2df35d292e8596f23cfa9189cf3f432dae17a781969b021a45166f0b3d5f926d' 
  AND (
    token = '6CuMM85WS/M96zRtTL8y+WCXiNMXG6XUWlY6c2LwGJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048