UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xiN0GBO/YK0D4i8kamf2m2ebd82RZNa0XDp54WlqWI=' 
WHERE 
  key_id = 'd10dd43c3cf7eeb8754abebffee847d9745f2ba7ec92c8b0e7e3fddfbfacf448' 
  AND (
    token = '8xiN0GBO/YK0D4i8kamf2m2ebd82RZNa0XDp54WlqWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027