UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xhCCjxzMr17/SxpV87KTMN+lFWPiE+z3kFy4dpcELFQ=' 
WHERE 
  key_id = 'c0f62f2a70ee95fe18df50628ad6c65282730c85be59b0fe9618382f5aeb6a69' 
  AND (
    token = 'xhCCjxzMr17/SxpV87KTMN+lFWPiE+z3kFy4dpcELFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039